// Created on 2008/02/22
// Last Updated on 2008/02/22

/*What has been done:
 ** Creation of the Coordinate Class
 *
 *What needs to be done:
 ** Clear definition of methods associated with class
 ** Implementation
 */

package gameUtils;


public class Coordinate{
	public int xPos;
	public int yPos;
	
	public boolean updateLocation(int dx, int dy){
		
		this.xPos = xPos + dx;
		this.yPos = yPos + dy;
		return true;
	}
	public void changeLocation(int xNew, int yNew){
		this.xPos = xNew;
		this.yPos = yNew;
	}
	
	public Coordinate compareToXMax(Coordinate p2){
		return (this.xPos > p2.xPos)?this:p2;
	}
	public Coordinate compareToYMax(Coordinate p2){
		return (this.yPos > p2.yPos)?this:p2;
	}
	public Coordinate compareToXMin(Coordinate p2){
		return (this.xPos > p2.xPos)?p2:this;
	}
	public Coordinate compareToYMin(Coordinate p2){
		return (this.yPos > p2.yPos)?p2:this;
	}
	
	public String toString(){
		return "X Position: "+xPos+"   Y Position: "+ yPos;
	}
	
	public Coordinate(){}
	
	public Coordinate(int x, int y){
		this.xPos = x;
		this.yPos = y;
		System.out.println("Coordinate Created. "+ this.toString());
	}
}
